package com.xzx.redislock.controller;

import com.xzx.redislock.service.IMiaoShaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class RedisLockController {

    @Autowired
    private IMiaoShaService miaoShaService;

    @RequestMapping("/page")
    public String toPage(){
        return "/test/page";
    }

    @RequestMapping("/miaosha")
    @ResponseBody
    public String miaoSha(String code,Integer countNum){
        return miaoShaService.miaoSha(code,countNum);
    }

}
